package com.itxh.registry;

import java.util.HashMap;
import java.util.Map;

public class SingletonBeanRegistry {
    // 用于存储创建出来的Bean对象，也就是通过该集合对Bean进行单例管理
    private Map<String, Object> singletonObjects = new HashMap<>();

    public void addSingleton(String beanName,Object bean){
        this.singletonObjects.put(beanName,bean);
    }

    public Object getSingleton(String beanName){
        return this.singletonObjects.get(beanName);
    }
}
